﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Social.Core.Contracts;
using Social.Core.Protocols;

namespace Facebook.Contracts
{
   
    /// <summary>
    /// Provides funcionality to make requests to Facebook API
    /// </summary>
    public interface IFacebookChannel
    {
        /// <summary>
        /// Gets and Sets the configuration associated with the Channel layer that is associated during the authorization process
        /// </summary>
        /// <see cref="Facebook.Facebookconfig"/>
        Facebookconfig Config
        {
            get;
            set;
        }

        /// <summary>
        /// Gets and Sets the comunication protocol used in the specific implementation
        /// </summary>
        IProtocol Protocol { get; set; }
        
        /// <summary>
        /// Gets or Sets the RequestFormatter associated 
        /// </summary>
        IRequestFormatter RequestFormatter { get; set; }

        /// <summary>
        /// Invokes facebook action url in the facebookconfig and return a json string
        /// </summary>
        /// <param name="querystringparams">url parameters to add to the request</param>
        /// <returns>json string</returns>
        string RequestGraph(string objectId, IDictionary<String, String> querystringparams);

        /// <summary>
        /// Provides the funcionality to build a Query Request type to facebook API
        /// </summary>
        /// <param name="queryStringParams"></param>
        /// <returns>json string</returns>
        string QueryGraph(IDictionary<String, string> queryStringParams);


        /// <summary>
        /// Provides the funcionality to build the request to get the Analytics to the application
        /// </summary>
        /// <param name="metric">metric to retrieve data</param>
        /// <param name="since">filter start date</param>
        /// <param name="until">filter  end date</param>
        /// <returns>json string</returns>
        string GetInsights(string metric, string since, string until);

    }
}
